<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditStudentTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditStudentLabel_studentId}" for="studentId" />
                    <h:inputText id="studentId" value="#{studentController.selected.studentId}" title="#{bundle.EditStudentTitle_studentId}" required="true" requiredMessage="#{bundle.EditStudentRequiredMessage_studentId}"/>
                    <h:outputLabel value="#{bundle.EditStudentLabel_rollNo}" for="rollNo" />
                    <h:inputText id="rollNo" value="#{studentController.selected.rollNo}" title="#{bundle.EditStudentTitle_rollNo}" required="true" requiredMessage="#{bundle.EditStudentRequiredMessage_rollNo}"/>
                    <h:outputLabel value="#{bundle.EditStudentLabel_name}" for="name" />
                    <h:inputText id="name" value="#{studentController.selected.name}" title="#{bundle.EditStudentTitle_name}" required="true" requiredMessage="#{bundle.EditStudentRequiredMessage_name}"/>
                    <h:outputLabel value="#{bundle.EditStudentLabel_gender}" for="gender" />
                    <h:inputText id="gender" value="#{studentController.selected.gender}" title="#{bundle.EditStudentTitle_gender}" />
                    <h:outputLabel value="#{bundle.EditStudentLabel_birthday}" for="birthday" />
                    <h:inputText id="birthday" value="#{studentController.selected.birthday}" title="#{bundle.EditStudentTitle_birthday}" >
                        <f:convertDateTime pattern="MM/dd/yyyy" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditStudentLabel_address}" for="address" />
                    <h:inputText id="address" value="#{studentController.selected.address}" title="#{bundle.EditStudentTitle_address}" />
                    <h:outputLabel value="#{bundle.EditStudentLabel_phone}" for="phone" />
                    <h:inputText id="phone" value="#{studentController.selected.phone}" title="#{bundle.EditStudentTitle_phone}" />
                    <h:outputLabel value="#{bundle.EditStudentLabel_email}" for="email" />
                    <h:inputText id="email" value="#{studentController.selected.email}" title="#{bundle.EditStudentTitle_email}" required="true" requiredMessage="#{bundle.EditStudentRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.EditStudentLabel_isActive}" for="isActive" />
                    <h:inputText id="isActive" value="#{studentController.selected.isActive}" title="#{bundle.EditStudentTitle_isActive}" required="true" requiredMessage="#{bundle.EditStudentRequiredMessage_isActive}"/>
                    <h:outputLabel value="#{bundle.EditStudentLabel_batchId}" for="batchId" />
                    <h:selectOneMenu id="batchId" value="#{studentController.selected.batchId}" title="#{bundle.EditStudentTitle_batchId}" required="true" requiredMessage="#{bundle.EditStudentRequiredMessage_batchId}">
                        <f:selectItems value="#{batchController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{studentController.update}" value="#{bundle.EditStudentSaveLink}"/>
                <br />
                <br />
                <h:link outcome="View" value="#{bundle.EditStudentViewLink}"/>
                <br />
                <h:commandLink action="#{studentController.prepareList}" value="#{bundle.EditStudentShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.EditStudentIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
